<template>
	<view>
	<view class="padding10 bankbg">
		<view>
			<text><b>温馨提示：</b></text>
		</view>
		<view>
			<text>1.收款名称：{{bankname}}</text>
			<button size="mini" type="primary" @click="copy(bankname)">复制</button>
		</view>
		<view>
			<text>2.收款账号：{{bankacc}}</text>
			<button size="mini" type="primary" @click="copy(bankacc)">复制</button>
		</view>
		<view>
			<text>3.支行信息：{{bankadd}}</text>
			<button size="mini" type="primary" @click="copy(bankadd)">复制</button>
		</view>
		<view v-if="bankmemo">
			<text>4.{{bankmemo}}</text>
		</view>
	</view>
	
	<view>
		<view class="list">
		    <text class="title">打款帐号</text>
		    <view>
		        <input type="text" v-model="inbankacc" placeholder="请输入打款帐号后四位" />
		    </view>
		</view>
		<view class="list">
		    <text class="title">时运亨亨</text>
		    <view>
		        <input type="text" v-model="username" placeholder="时运亨亨注册的手机号" />
		    </view>
		</view>
		<view class="list">
		    <text class="title">打款金额</text>
		    <view>
		        <input type="text" v-model="money"  placeholder="向帐户内转入的金额" />
		    </view>
		</view>
	</view>
	<view class="padding10">
		<text style="color: red;">
			为了即时完成此订单，打款时请务必在附言/备注栏里填写注册时运亨亨账户的手机号码，谢谢！

		</text>
	</view>
	<view class="addrbtn" @click="submit">确定提交</view>
	</view>
</template>

<script>
	export default {
	   
	    data() {
	        return {
				
	            bankname:'',
				bankacc:'',
				bankadd:'',
				bankmemo:'',
				inbankacc:'',
				username:'',
				money:'',
				orderid:''
	        };
	    },
	    /**
	     * 生命周期函数--监听页面加载
	     */
	    onLoad: function (options) {
	        this.orderid = options.orderid;
	        this.init();
	    },
	    /**
	     * 生命周期函数--监听页面初次渲染完成
	     */
	    onReady: function () {},
	    /**
	     * 生命周期函数--监听页面显示
	     */
	    onShow: function () {},
	    /**
	     * 生命周期函数--监听页面隐藏
	     */
	    onHide: function () {},
	    /**
	     * 生命周期函数--监听页面卸载
	     */
	    onUnload: function () {},
	    /**
	     * 页面相关事件处理函数--监听用户下拉动作
	     */
	    onPullDownRefresh: function () {},
	    /**
	     * 页面上拉触底事件的处理函数
	     */
	    onReachBottom: function () {
	       
	    },
	    methods: {
	        
	        init() {
	            var _this = this;
				_this.$http('app/center/getbank',{orderid:_this.orderid},function(v){
					_this.bankname = v.data.bankname;
					_this.bankacc = v.data.bankacc;
					_this.bankadd = v.data.bankadd;
					_this.bankmemo = v.data.bankmemo;
					_this.username = v.data.username;
					_this.money = v.data.money;
				})
	        },
			submit(){

				var that = this;
				var inputdata = {
					inbankacc:this.inbankacc,
					phone:this.username,
					money:this.money,
					orderid:this.orderid
				}
				this.$http('app/order/submitorder',inputdata,function(v){
					uni.showToast({
						title:v.msg
					});
					setTimeout(function(){
						uni.reLaunch({
							url:'/pages/index/index'
						})
					},1200)
				})
			},
			copy(txt){
				uni.setClipboardData({
					data:txt,
					success:()=>{
						uni.showToast({
							title:'复制成功',
							icon:'none'
						})
					}
				})
			}
	    }
	};
	
</script>

<style lang="scss"> @import 'main.scss';
@import './bank.scss';
</style>